﻿Imports System.Xml
Imports System.Text
Imports System.IO
Imports Mysoft.Map.Workflow.Utility
Imports Mysoft.Map.Workflow.Public
Imports Mysoft.Map.Workflow

Partial Public Class WF_ProcessHandle_Process
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("processGUID") Is Nothing Then
                Dim xml As String = Engine.ProcessDisplay.GetProcessHandleXml(Request.QueryString("processGUID"))
                txtProcessGUID.Text = Request.QueryString("processGUID")

                Dim xmlDoc As New XmlDocument
                Dim xslt As Xsl.XslCompiledTransform

                xmlDoc.LoadXml(xml)
                txtHandleXml.Text = xml
                xslt = WFCache.GetXsltFileDoc("/MyWorkflow/XSLT/WF_ProcessHandle_Preview.xslt")
                Dim argsList As New Xsl.XsltArgumentList()
                argsList.AddParam("curNodeGUID", "", IIf(Request.QueryString("nodeGUID") = Nothing, "", Request.QueryString("nodeGUID")))
                argsList.AddParam("mode", "", IIf(Request.QueryString("mode") = Nothing, "", Request.QueryString("mode")))
                Dim output As New StringBuilder("")
                Dim writer As New StringWriter(output)

                xslt.Transform(xmlDoc, argsList, writer)

                divGrid.InnerHtml = output.ToString()

            End If
        End If
    End Sub

End Class